package com.zc.controller;

import com.zc.base.ResponseResult;
import com.zc.pojo.User;
import com.zc.service.LoginService;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.net.http.HttpRequest;

/**
 * @description:
 * @author: cong
 * @create: 2024/8/5
 */
@RestController
public class LoginController {
    @Autowired
    private LoginService loginService;

    @PostMapping("/login")
    public ResponseResult login(@RequestBody User user) {
        return loginService.login(user);
    }

    @PostMapping("/exit")
    public ResponseResult logout() {
        return loginService.logout();
    }
}
